/*
 * Created on 05/07/2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package br.ufmg.dees.insane.xyplot.xyplot_view.command;

import javax.swing.JInternalFrame;

import br.ufmg.dees.insane.commons.command.Command;
import br.ufmg.dees.insane.xyplot.xyplot_view.InterfaceXYPlot;


/**
 * @author  Samuel Silva Penna  TODO To change the template for this generated type comment go to  Window - Preferences - Java - Code Style - Code Templates
 */
public class BoundaryCommand implements Command{
    
    private InterfaceXYPlot parent;
    
//*****************************************************************************
    
    /** Creates new BoundaryCommand */
    public BoundaryCommand(JInternalFrame parent) {
        this.parent = (InterfaceXYPlot)parent;
    }
    
//*****************************************************************************
    
    public void execute() {
     
        if (parent.getView().getViewState().isBoundaryOn()) {
            parent.getView().getViewState().setBoundary(false);

        } else {
            parent.getView().getViewState().setBoundary(true);
        }
        
        parent.getView().getDrawingArea().repaint();
        parent.setStateButtons();
    }
    
//*****************************************************************************
    
    public void undo() {
    }
    
//*****************************************************************************
    
    public void redo() {
    }
    
//*****************************************************************************
}



